package com.tenement.enums;



public enum Command {

    //断线
    OFFLINE(199),

    //连接
    CONNECT(200),

    //单聊
    PRIVATE(201),

    // 群
    GROUP(202),

    //广播
    RADIO(203),

    //在线广播
    LINERADIO(204),

    //活跃
    ACTIVE(205);

    private final int code;

    Command(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static Command match(int code) {
        for (Command CommandEnum : values()) {
            if (CommandEnum.getCode() == code ) {
                return CommandEnum;
            }
        }
        return null;
    }

}
